[GENERAL] Two variable passed to PL/Function and on is NULL

Поиск
Список
Период
Сортировка
От Stuart Rison
Тема [GENERAL] Two variable passed to PL/Function and on is NULL
Дата
Msg-id v04020a05b38aa7ad8bc7@[128.40.242.190]
обсуждение исходный текст
Ответы Re: [GENERAL] Two variable passed to PL/Function and on is NULL
Список pgsql-general
Dear All,

I have written a PL/pgSQL fucntion which takes two arguments and returns a
boolean on the basis of a few (string) comparaisons.

The function works fine as long as BOTH passed variables are non-NULL but
behaves strangely if one of the variables is non-NULL.

Looking at previous postings, I found:

>Very observant of you.  The postgres function system doesn't have a way
>to tell which parameter is null, so the function just returns null.
>I don't like it and we hope to get it changed for PGv6.5 (at least I
>do).

Now that example was with a 'c' function but presumably, function are
handled the same way internally whatever the function language?

SO my question are:

i) Is it the case that if you pass to variables to a postgres function and
one is NULL, the function cannot tell which one?
ii) Is there a workaround of some kind (in particular in pl/pgsql)?
[Currently I am copying the table into a temp table and updating all NULL
values to a token value.]

regards,

Stuart.


+-------------------------+--------------------------------------+
| Stuart Rison            | Ludwig Institute for Cancer Research |
+-------------------------+ 91 Riding House Street               |
| Tel. (0171) 878 4041    | London, W1P 8BT, UNITED KINGDOM.     |
| Fax. (0171) 878 4040    | stuart@ludwig.ucl.ac.uk              |
+-------------------------+--------------------------------------+

В списке pgsql-general по дате отправления:

Предыдущее
От: Sascha Schumann
Дата:
Сообщение: Re: [GENERAL] Re: [HACKERS] postgres processes
Следующее
От: Herouth Maoz
Дата:
Сообщение: Re: [GENERAL] Two variable passed to PL/Function and on is NULL